import numpy as np
from config.network import *

ALGORITHM = ['AES','SM4']
ATTACK_METHOD=['CPA','DPA','TA','DLSCA']
ATTACK_METHOD_NONPROFILE=['CPA','DPA']
ATTACK_METHOD_PROFILE=['TA','DLSCA']

LEAKAGE_MODEL = {
    'AES':
        [
            'R1_SboxInID', 'R1_SboxInHW', 'R1_SboxInMBit',
            'R1_SboxOutID', 'R1_SboxOutHW', 'R1_SboxOutMBit',
            'R10_RoundXor', 'R10_RoundHD', 'R10_RoundMBit',
        ],
    'SM4':
        [
            'Enc_SboxInID', 'Enc_SboxInHW', 'Enc_SboxInMBit',
            'Enc_SboxOutID', 'Enc_SboxOutHW', 'Enc_SboxOutMBit',
            'Dec_SboxInID', 'Dec_SboxInHW', 'Dec_SboxInMBit',
            'Dec_SboxOutID', 'Dec_SboxOutHW', 'Dec_SboxOutMBit',
            'Enc_RoundXor','Enc_RoundHD','Enc_RoundMBit'
        ]
}

NETWORK = {
    'MLP1': DLNW_MLP1,
    'MLP2': DLNW_MLP2,
    'CNN1': DLNW_CNN1,
    'CNN2': DLNW_CNN2,
    'RESNET': DLNW_RESNET,
    'CNNMGU': DLNW_CNNMGU,
    'LSTM': DLNW_LSTM,
    'CNNLSTM': DLNW_CNNLSTM,
    'SelfAttention':DLNW_SelfAttention
}

HW_ARRAY = np.array([
    0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
    1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
    2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
    3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
    4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
])